<?php
/**
 * $Horde: groo/lib/prefs.php,v 1.2.10.4 2006/01/01 21:29:06 jan Exp $
 *
 * Copyright 2002-2006 Chuck Hagenbuch <chuck@horde.org>
 *
 * See the enclosed file LICENSE for license information (ASL). If you
 * did not receive this file, see http://www.horde.org/licenses/asl.php.
 *
 * @author  Chuck Hagenbuch <chuck@horde.org>
 * @since   Groo 2.0
 * @package Groo
 */

function handle_collectionselect($updated)
{
    global $prefs;

    $default_collection = Util::getFormData('default_collection');
    if (!is_null($default_collection)) {
        $collections = Groo::listCollections();
        if (is_array($collections) && array_key_exists($default_collection, $collections)) {
            $prefs->setValue('default_collection', $default_collection);
            $updated = true;
        }
    }
    return $updated;
}

function handle_showsummaryselect($updated)
{
    global $prefs;

    $summary_categories = Util::getFormData('summary_categories');
    $prefs->setValue('summary_categories', $summary_categories);
    return true;
}
